home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / hypercar / xfcn / spttool.cpt / Support Tools eXternals 1.2.5 / card_30563.txt < prev    next >
Text File  |  1990-11-13  |  3KB  |  125 lines

  1. -- card: 30563 from stack: in.5
  2. -- bmap block id: 7154
  3. -- flags: 0000
  4. -- background id: 3858
  5. -- name: CDDriveList
  6. ----- HyperTalk script -----
  7. on CloseCard
  8.   put empty into cd fld "ids"
  9.   put empty into cd fld "disk present"
  10.   pass CloseCard
  11. end CloseCard
  12.  
  13. on HideObjects
  14.   hide cd fld "label"
  15.   hide cd fld "disk present"
  16.   hide cd fld "ids"
  17.   hide cd btn "try it!"
  18. end HideObjects
  19.  
  20. on ShowObjects
  21.   show cd fld "label"
  22.   show cd fld "disk present"
  23.   show cd fld "ids"
  24.   show cd btn "try it!"
  25. end ShowObjects
  26.  
  27.  
  28. -- part 1 (button)
  29. -- low flags: 00
  30. -- high flags: A002
  31. -- rect: left=70 top=283 right=317 bottom=163
  32. -- title width / last selected line: 0
  33. -- icon id / first selected line: 0 / 0
  34. -- text alignment: 1
  35. -- font id: 0
  36. -- text size: 12
  37. -- style flags: 8192
  38. -- line height: 16
  39. -- part name: Try It!
  40. ----- HyperTalk script -----
  41. on mouseUp
  42.   global errGlobal
  43.   put empty into cd fld "disk present"
  44.   put empty into cd fld "ids"
  45.   put CDDriveList("noDialog:errGlobal") into CDdata
  46.   if errGlobal Γëá empty then
  47.     answer "Error: ΓÇ£" & errGlobal & "ΓÇ¥"
  48.     put empty into errGlobal
  49.   else
  50.     if CDData = empty then
  51.       answer "No CD-ROM drives found."
  52.       exit mouseUp
  53.     end if
  54.     repeat with driveNdx = 1 to the number of items in line 1 of CDData
  55.       put (item driveNdx of line 1 of CDData) & return after cd fld "ids"
  56.       put item driveNdx of line 2 of CDData & return after cd fld "disk present"
  57.     end repeat
  58.   end if
  59. end mouseUp
  60.  
  61.  
  62.  
  63.  
  64. -- part 2 (field)
  65. -- low flags: 00
  66. -- high flags: 2002
  67. -- rect: left=110 top=129 right=276 bottom=170
  68. -- title width / last selected line: 0
  69. -- icon id / first selected line: 0 / 0
  70. -- text alignment: 0
  71. -- font id: 4
  72. -- text size: 12
  73. -- style flags: 0
  74. -- line height: 16
  75. -- part name: disk present
  76.  
  77.  
  78. -- part 3 (field)
  79. -- low flags: 00
  80. -- high flags: 2002
  81. -- rect: left=56 top=129 right=276 bottom=111
  82. -- title width / last selected line: 0
  83. -- icon id / first selected line: 0 / 0
  84. -- text alignment: 1
  85. -- font id: 4
  86. -- text size: 12
  87. -- style flags: 0
  88. -- line height: 16
  89. -- part name: ids
  90.  
  91.  
  92. -- part 5 (field)
  93. -- low flags: 00
  94. -- high flags: 0000
  95. -- rect: left=51 top=102 right=129 bottom=185
  96. -- title width / last selected line: 0
  97. -- icon id / first selected line: 0 / 0
  98. -- text alignment: 0
  99. -- font id: 3
  100. -- text size: 10
  101. -- style flags: 256
  102. -- line height: 13
  103. -- part name: label
  104.  
  105.  
  106. -- part contents for background part 38
  107. ----- text -----
  108. 6/50
  109.  
  110. -- part contents for card part 5
  111. ----- text -----
  112. CD-ROM     Disk
  113.  SCSI ID   Present?
  114.  
  115. -- part contents for background part 20
  116. ----- text -----
  117.      An XFCN which returns a list of the SCSI IDs of all attached CD-ROM drives, and the state of the drives (empty or full).  The first line of the result is a comma delimited list of the SCSI IDs.  The second line of the result is a comma delimited list, matching the ID list item for item, in which a "false" indicates an empty drive, and a "true" indicates a drive with a CD in it.  For instance the result 
  118.  
  119. 3,4,6 
  120. true,false,true
  121.  
  122. would indicate that three CD drives are attached (lucky soul!) at SCSI IDs 3, 4, and 6.  The drives at IDs 3 and 6 have disks in them, while the drive at 4 is empty.
  123.  
  124.      Calling Syntax: CDDriveList(<"noDialog:"errorGlobal>
  125.